import { createRouter, createWebHistory } from 'vue-router'
import RegisterView from "@/views/register/index.vue"
import LoginView from "@/views/login/index.vue"
import HomeView from '@/views/home/index.vue'
import ShouView from '@/views/home/home.vue'
import FenView from '@/views/home/fen.vue'
import CeatView from '@/views/home/ceat.vue'
import MyView from '@/views/home/my.vue'
import SousuoView from '@/views/sousuo/index.vue'
import XiangqingView from '@/views/xiangqing/index.vue'
import GoodsView from '@/views/goods/index.vue'
import PayokView from '@/views/payok/index.vue'
import PayView from '@/views/pay/index.vue'
const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    { path: '/', redirect: '/home/home' },
    {
      path: '/register',
      name: 'register',
      component: RegisterView,
    },
    {
      path: "/goods/:cat_id",
      component: GoodsView,
    },
    {
      path: '/login',
      name: 'login',
      component: LoginView,
    },
    {
      path: '/xiangqing/:goods_id',
      name: 'xiangqing',
      component: XiangqingView,
    },
    {
      path: '/sousuo',
      name: 'sousuo',
      component: SousuoView,
    },
    {
      path: '/payok',
      name: 'payok',
      component: PayokView,
    },
    {
      path: '/pay',
      name: 'pay',
      component: PayView,
    },
    {
      path: '/home',
      name: 'home',
      component: HomeView,
      children: [
        {
          path: 'home',

          component: ShouView,
        },
        {
          path: 'fen',

          component: FenView,
        },
        {
          path: 'ceat',
          name: 'ceat',
          component: CeatView,
        },
        {
          path: 'my',
          name: 'my',
          component: MyView,
        },

      ]
    },

  ],
})


export default router
